<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title></title>
</head>

<body>

	<script>
		function imgLoad(url) {
			return new Promise(function (resolve, reject) {
				var request = new XMLHttpRequest();
				request.open('GET', url);
				request.responseType = 'blob';
				request.onload = function () {
					if (request.status === 200) {
						resolve(request.response);
					} else {
						reject(Error('Image didn\'t load successfully; error code:' + request.statusText));
					}
				};
				request.onerror = function () {
					reject(Error('There was a network error.'));
				};
				request.send();
			});
		}

		var body = document.querySelector('body');
		var myImage = new Image();
		imgLoad('img/360截图20191004145544832.jpg').then( (response) => {
			console.log(response);
			var imageURL = window.URL.createObjectURL(response);
			console.log(imageURL)
			myImage.src = imageURL;
			console.log(myImage)
			body.appendChild(myImage);
		}).catch((err) => {
			console.log(err)
		})
	</script>
</body>

</html>